package com.itheima.homework;

import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入:");
        String s = sc.nextLine();
        int numCount = 0;
        int stringCount = 0;
        for(int i = 0;i < s.length();i++){
            char c = s.charAt(i);
            if((c >= 'a' && c <='z') || (c >= 'A' && c <= 'z')){
                stringCount++;
            }else if(c >= '0' && c <='9'){
                numCount++;
            }
        }
        System.out.println("字母:" + stringCount);
        System.out.println("数字:" + numCount);
    }
}
